<template>
	<div class="header-project-name">
		<el-tag class="p_name" v-for="(item,index) in projectList" :key="index" @click="handleSelectProject(item,index)"
		 :type="index === curProjectIndex ? '' : 'info'">
			项目名称：《{{ item.project.projectname }}》
		</el-tag>
	</div>
</template>

<script>
	export default{
		props:{
			projectList:{  //进行项目和历史项目的项目列表
				type:Array,
				default:[]
			},
			curProjectIndex:{ // 当前项目的索引
				type:Number,
				default:0
			}
		},
		methods:{
			handleSelectProject(item,index){
				this.$emit('handleSelectProject',item,index);
			}
		}
	}
</script>

<style lang="scss">
	.header-project-name {
		flex-wrap: wrap;
	
		@include f-ai-jc(flex, center, flex-start) .p_name {
			margin: 5px;
			cursor: pointer;
		}
	}
</style>
